**************************************************************************************
*TABLE 5: Number of firms with foreign and offshore entities in ownership chain
***************************************************************************************

*Baseline (Columns 1 and 2)
use "Regressions Data/baseline0406_nown.dta",clear
set more off
keep if year==2004

reg dfo orange gray lemp tfp privatized sec1 sec2 sec4-sec10, robust 
keep if e(sample)

keep okpo
merge 1:m okpo using  "Regressions Data/baseline0406_nown.dta"

tab year if foreign_in_chain==1
tab year if foreign_in_chain==1 & blue==1
tab year if foreign_in_chain==1 & orange==1
tab year if foreign_in_chain==1 & gray==1

tab year if offshore==1
tab year if offshore==1 & blue==1
tab year if offshore==1 & orange==1
tab year if offshore==1 & gray==1

*JSCReg only (Columns 3 and 4)
use "Regressions Data/JSCReg0406_nown.dta",clear
set more off
keep if year==2004

reg dfo orange gray lemp tfp privatized sec1 sec2 sec4-sec10, robust 
keep if e(sample)

keep okpo
merge 1:m okpo using "Regressions Data/JSCReg0406_nown.dta"
keep if _merge==3

tab year if foreign_in_chain==1
tab year if foreign_in_chain==1 & blue==1
tab year if foreign_in_chain==1 & orange==1
tab year if foreign_in_chain==1 & gray==1

tab year if offshore==1
tab year if offshore==1 & blue==1
tab year if offshore==1 & orange==1
tab year if offshore==1 & gray==1
